/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.*;

/**
 * @author Abahe
 */
public class MainMIDlet extends MIDlet {
    Display display;
    MenuCanvas menuCanvas;
    SplashScreen splashScreen;
    MainGameCanvas mainGameCanvas;
    
    public void startApp() {
        display = Display.getDisplay(this);
        showSplashScreen();
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void showMenuCanvas(){
        splashScreen = null;
        menuCanvas = new MenuCanvas(this);
        display.setCurrent(menuCanvas);
    }

    public void showMainGameCanvas(){
        menuCanvas = null;        
        mainGameCanvas = new MainGameCanvas(this);
        display.setCurrent(mainGameCanvas);
        mainGameCanvas.start();
    }
    
    public void showSplashScreen(){
        splashScreen = new SplashScreen(this);
        display.setCurrent(splashScreen);
        splashScreen.start();
    }
}
